# coding = utf-8
from django.urls import path
from rest_framework.routers import DefaultRouter

from shopping.api.views import GoodsViewSet, GoodsImageViewSet, CategoryViewSet, GoodsContentImageUploadAPIView, \
    GoodsImageUploadAPIView, GiftPackageViewSet, GoodsListAPIView
from shopping.api.wechat_views import CategoryListAPIView, WxGoodsReadOnlyViewSet, WxGiftPackageListAPIView

router = DefaultRouter()
router.register(r'goods', GoodsViewSet, basename="goods")
router.register(r'goods_image', GoodsImageViewSet, basename="goods-image")
router.register(r'category', CategoryViewSet, basename="category")
router.register(r'goods_list', WxGoodsReadOnlyViewSet, basename="api-goods-list")
router.register(r'gift_pack', GiftPackageViewSet, basename="api-gift-pack")


urlpatterns = [
    path('image_upload/', GoodsImageUploadAPIView.as_view(), name="api-goods-image-upload"),
    path('content_image_upload/', GoodsContentImageUploadAPIView.as_view(), name="api-goods-content-image-upload"),
    path('category_list/', CategoryListAPIView.as_view(), name="api-category-list"),
    path('goods_code_list/', GoodsListAPIView.as_view(), name="api-code-goods-list"),
    path('wx_gift_pack/', WxGiftPackageListAPIView.as_view(), name="api-wx-gift-pack"),
]
urlpatterns += router.urls
